#pragma once

#include <engine.core/math.hpp>

#include "exports.hpp"
#include "Component.hpp"




namespace Engine
{
	namespace Entity
	{
		class ENGINE_ENTITY_API PositionComponent
			: public Component
		{
		public:

			typedef Script::pointer<PositionComponent>   ptr;

			static PositionComponent* create();

			PositionComponent();
			virtual ~PositionComponent();



			/**
			 * @returns a number that identifies the type of a component
			 */
			virtual ID id() const;




			/**
			 * Sets the position of the attached entity.
			 */
			void setPosition(float3 position);

			/**
			 * Sets the rotation of the attached entity.
			 */
			void setRotation(float3x3 rotation);



			/**
			 * @returns the position of the attached entity
			 */
			float3 position() const;

			/**
			 * @returns the rotation of the attached entity
			 */
			float3x3 rotation() const;



			/**
			 * Registers the script system type with angelscript.
			 */
			static void registerType(Script::System::ptr engine);

		private:

			float4x4   m_transform;

		};
		///////////////////////////////////////////////////////////////////////////////////////////
	}
	///////////////////////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////////////////////////
